using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class SM_PKT_OverheadMap : EntityTypeConfiguration<SM_PKT_Overhead>
    {
        public SM_PKT_OverheadMap()
        {
            // Primary Key
            this.HasKey(t => new { t.ID, t.SPID });

            // Properties
            this.Property(t => t.ID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.name)
                .HasMaxLength(50);

            this.Property(t => t.ValueType)
                .HasMaxLength(1);

            this.Property(t => t.Type)
                .HasMaxLength(20);

            this.Property(t => t.SPID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            // Table & Column Mappings
            this.ToTable("SM_PKT_Overhead");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.name).HasColumnName("name");
            this.Property(t => t.ValueType).HasColumnName("ValueType");
            this.Property(t => t.Perc).HasColumnName("Perc");
            this.Property(t => t.Amount).HasColumnName("Amount");
            this.Property(t => t.Currency).HasColumnName("Currency");
            this.Property(t => t.Type).HasColumnName("Type");
            this.Property(t => t.Note).HasColumnName("Note");
            this.Property(t => t.SPID).HasColumnName("SPID");
            this.Property(t => t.AutoApply).HasColumnName("AutoApply");
        }
    }
}
